


import urllib.request


req =  urllib.request.Request("http://hoholoving.com/aa")

try:
    urllib.request.urlopen(req)

except urllib.error.URLError as e:
    
    if hasattr(e,"reason"):
        print("我有一个理由",e.reason)
    elif hasattr(e,"code"):
        print("我是状态啊",e.code)

else:
    print("一切ok'") 